package principle.singleton;

/**
 * @author malguy-wang sir
 * @create ${year}-${month}-${day}-${time}
 */
public class type1 {
    public static void main(String[] args) {
        single s1 = single.INSTANCE;
        single s2 = single.INSTANCE;
        System.out.println(s1 == s2);
        System.out.println(s1.hashCode() == s2.hashCode());
        s1.say();
    }

}

enum single{
    INSTANCE ;//属性
    public void say(){
        System.out.println("hello");
    }
}